import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/flowmodel',
    method: 'GET',
    params: query
  })
}

//

export function UpdateDesign(data) {
  return request({
    url: `/flowmodel/UpdateDesign/${data.Id}`,
    method: 'PUT',
    data
  })
}

export function getProcessModel(id) {
  return request({
    url: `/flowmodel/${id}`,
    method: 'GET'
  })
}

export function saveProcessModel(data) {
  return request({
    url: '/flowmodel',
    method: 'POST',
    data
  })
}

export function publishProcessModel(id) {
  return request({
    url: `/flowmodel/publicprocess/${id}`,
    method: 'GET'
  })
}

export function deleteTenant(id) {
  return request({
    url: `/tenant/${id}`,
    method: 'DELETE'
  })
}

export function updateProcessModel(data) {
  return request({
    url: `/flowmodel/${data.Id}`,
    method: 'PUT',
    data
  })
}
